Skip to content

FEATURE: Allow PHP 7 type declaration#79

Open
DanielSiepmann wants to merge 2 commits intoKonafets:developfrom
DanielSiepmann:feature/allow-php7-type-declaration
Open

FEATURE: Allow PHP 7 type declaration#79
DanielSiepmann wants to merge 2 commits intoKonafets:developfrom
DanielSiepmann:feature/allow-php7-type-declaration

Conversation

@DanielSiepmann
Copy link
Copy Markdown
Contributor

@DanielSiepmann
Copy link
Copy Markdown
Contributor Author

Otherwise the following code will result in errors:

protected function shouldExecuteHook(string $action, string $table, string $recordUid, array $modifiedFields) : bool 
-------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 4 LINES                                                                                               
-------------------------------------------------------------------------------------------------------------------------------
 160 | ERROR | Unknown type hint "string" found for $action (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)        
 160 | ERROR | Unknown type hint "string" found for $table (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)         
 160 | ERROR | Unknown type hint "string" found for $recordUid (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)     
 202 | ERROR | Unknown type hint "string" found for $fieldToModify (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint) 
 223 | ERROR | Unknown type hint "string" found for $recordUid (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)     
 245 | ERROR | Unknown type hint "int" found for $pageUid (TYPO3SniffPool.Commenting.FunctionComment.InvalidTypeHint)          
-------------------------------------------------------------------------------------------------------------------------------

@DanielSiepmann
Copy link
Copy Markdown
Contributor Author

Looks like the failing result is not due to the change? Or someone has to help me to understand the result so I can fix the broken part.

@Konafets
Copy link
Copy Markdown
Owner

Thanks for the PR! It seems something is wrong with PHPCS itself. I will have a look at this and your PR as well.

@DanielSiepmann
Copy link
Copy Markdown
Contributor Author

Thanks for taking a look.

I've also noticed that PHPCS or TYPO3SniffPool, don't know anymore which exactly, has issues with yield, too. So generators will also fail.

* As yield is nearly the same as return, we should allow phpdoc
  annotation, unless PSR is finished for PHPDocs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants